from random import choice

list1 =['B','b']
list2 =['B','b']
list3 =[]
I =0
BB =0
Bb =0
bb =0
for i in range(1,10000001):
    I=I+1
    a =str(choice(list1))
    b =str(choice(list2))
    c =a+b
    d =b+a

    if a =='B' and b =='B':
        list3.append(c)
    elif a =='b' and b =='B':
         list3.append(d)
    elif a =='B' and b =='b':
         list3.append(c)
    elif a =='b' and b =='b':
         list3.append(c)

for e in list3:
    if e =='BB':
        BB = BB+1
    elif e =='Bb':
        Bb = Bb+1
    else:
        bb =bb+1
#print(list3)
print('BB出现次数：',BB)
print('Bb出现次数：',Bb)
print('bb出现次数：',bb)

print('BB出现频率：',BB/I)
print('Bb出现频率：',Bb/I)
print('bb出现频率：',bb/I)
